<?php
/*
 * Created on 01.02.2006
 *
 */
 
class conf_defaultErrorActionHandler
{

    function startElement (& $sender, $attrs, $line)
    {
        if (empty($attrs['class']))
            die("Attribute class missing in tag action in line $line\n"); 
        if (preg_match('/\$\{/', $attrs['class']))
            die ("Attribute class must not contain EL code in tag defaultAction in line $line.\n");
        $file = substr($attrs['class'], 1, strlen($attrs['class'])-2);
        $matches = array();
        preg_match('/(\w+)$/',$file,$matches);
        $class = $matches[1];
        $sender->appendCode('$defaulterroraction["file"] = \''.$file."';\n");
        $sender->appendCode('$defaulterroraction["class"] = \''.$class."';\n");
        $action['type'] = 'action';
        // if $attrs['mapping'] not defiend clas name used
        $action['mapping'] = "'".$class."'";
        $sender->pushParent($action);
    }
    
    function endElement (& $sender)
    {
        $sender->popParent();
    }

} 


?>
